package gui;

/*
 * @Author: Andy Vidkjaer
 */

import java.awt.EventQueue;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.Icon;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JTextArea;
import javax.swing.UIManager;

public class alertDialog extends JDialog {
	
	public alertDialog(String message, String title) {
		
		this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
		
		getContentPane().setFont(new Font("Tahoma", Font.PLAIN, 14));
		
		setBounds(100, 100, 311, 206);
		getContentPane().setLayout(null);
		this.setTitle(title);
		Icon icon = UIManager.getIcon("OptionPane.errorIcon");
		JLabel lblIcon = new JLabel(icon);
		lblIcon.setBounds(12, 53, 32, 32);
		getContentPane().add(lblIcon);
		
		JButton btnOk = new JButton("Ok");
		btnOk.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				alertDialog.this.dispose();
			}
		});
		btnOk.setBounds(98, 123, 97, 25);
		getContentPane().add(btnOk);
		
		JTextArea textArea = new JTextArea();
		textArea.setEditable(false);
		textArea.setText(message);
		textArea.setBounds(73, 28, 150, 66);
		getContentPane().add(textArea);

		
		this.setVisible(true);
	}
}
